package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusExperimentSchemeMapper;
import com.ruoyi.business.domain.BusExperimentScheme;
import com.ruoyi.business.service.IBusExperimentSchemeService;

/**
 * 实验方案Service业务层处理
 * 
 * @author asher
 * @date 2021-10-28
 */
@Service
public class BusExperimentSchemeServiceImpl implements IBusExperimentSchemeService 
{
    @Autowired
    private BusExperimentSchemeMapper busExperimentSchemeMapper;

    /**
     * 查询实验方案
     * 
     * @param schemeId 实验方案主键
     * @return 实验方案
     */
    @Override
    public BusExperimentScheme selectBusExperimentSchemeBySchemeId(Long schemeId)
    {
        return busExperimentSchemeMapper.selectBusExperimentSchemeBySchemeId(schemeId);
    }

    /**
     * 查询实验方案列表
     * 
     * @param busExperimentScheme 实验方案
     * @return 实验方案
     */
    @Override
    public List<BusExperimentScheme> selectBusExperimentSchemeList(BusExperimentScheme busExperimentScheme)
    {
        return busExperimentSchemeMapper.selectBusExperimentSchemeList(busExperimentScheme);
    }

    /**
     * 新增实验方案
     * 
     * @param busExperimentScheme 实验方案
     * @return 结果
     */
    @Override
    public int insertBusExperimentScheme(BusExperimentScheme busExperimentScheme)
    {
        busExperimentScheme.setCreateTime(DateUtils.getNowDate());
        return busExperimentSchemeMapper.insertBusExperimentScheme(busExperimentScheme);
    }

    /**
     * 修改实验方案
     * 
     * @param busExperimentScheme 实验方案
     * @return 结果
     */
    @Override
    public int updateBusExperimentScheme(BusExperimentScheme busExperimentScheme)
    {
        busExperimentScheme.setUpdateTime(DateUtils.getNowDate());
        return busExperimentSchemeMapper.updateBusExperimentScheme(busExperimentScheme);
    }

    /**
     * 批量删除实验方案
     * 
     * @param schemeIds 需要删除的实验方案主键
     * @return 结果
     */
    @Override
    public int deleteBusExperimentSchemeBySchemeIds(Long[] schemeIds)
    {
        return busExperimentSchemeMapper.deleteBusExperimentSchemeBySchemeIds(schemeIds);
    }

    /**
     * 删除实验方案信息
     * 
     * @param schemeId 实验方案主键
     * @return 结果
     */
    @Override
    public int deleteBusExperimentSchemeBySchemeId(Long schemeId)
    {
        return busExperimentSchemeMapper.deleteBusExperimentSchemeBySchemeId(schemeId);
    }
}
